<?php

namespace app\store\controller\gifts;
use app\store\controller\Controller;
use app\store\model\GiftsOrder as GiftsOrderModel;

/**
 * 爆品礼物管理控制器
 * Class Goods
 * @package app\store\controller
 */
class GiftsOrder extends Controller
{
    /**
     * 爆品礼物订单
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function index()
    {
        // 获取全部商品列表
        $model = new GiftsOrderModel;
        $list = $model->getList($this->request->param());

        return $this->fetch('index', compact('list'));
    }

    /**
     * 爆品礼物订单
     * @return mixed
     * @throws \think\exception\DbException
     */
    public function detail()
    {
        // 获取全部商品列表
        $model = new GiftsOrderModel;
        $list = $model->getList($this->request->param());

        return $this->fetch('index', compact('list'));
    }



    /**
     * 订单导出
     * @param string $dataType
     * @throws \think\exception\DbException
     */
    public function export()
    {
        $model = new GiftsOrderModel;

        if (!$model->exportList($this->request->param())) {
            return $this->renderError($model->getError() ?: '操作失败');
        }

        return $model->exportList($this->request->param());
    }

}
